Many computer applications may perform computations involving a mask constraint. For example, many applications may involve generating one or more numbers satisfying a mask constraint, e.g., in the context of Pseudo Random Test Generators (PRTGs) for hardware verification. Hardware verification may include generating op-code instructions requiring generation of numbers that satisfy a mask constraint, for example, in order to generate machine code instructions with fixed op codes and variable operands.
Some computing systems, for example, computing systems including post-silicon PRTGs, may be required to perform computations associated with a mask constraint while consuming relatively short computation time and/or small memory space.
Some computations, which relate to a mask constraint, may be performed more efficiently with relation to a bitset constraint representing the mask constraint. For example, the implementation of the bitset constraint may enable using a single Boolean manipulating machine instruction to perform set operations, e.g., union (logical OR), intersection (logical AND), complement (logical negation), membership checking (bit check), and the like. The mask constraint may be replaced by the bitset constraint, for example, if the size of a domain, which corresponds to a set of numbers that possibly satisfy the mask constraint, does not exceed a word size of a machine or device performing the computations. For example, a 32-bit machine word-size may enable using a bitset constraint to represent a domain of the numbers 0-31.